package com.rlyy.rsj.entity;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author : shibixiao
 * @description : 使用量提醒类
 * @date : 2021-06-30 09:41
 **/
@Deprecated
@Data
public class UsageRemindEntity {

    private String orgId;

    private String orgName;

    private String orgpId;

    private String orgpProdUid;

    private String orgpProdName;

    private String orgpCostType;

    private int orgpBuyamount;

    private int orgpUseamount;

    private String receiveUser;

    private String receiveUsermail;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime statisticTime;

    private String mailTemplate;

    public double getOrgpUsePercent(){
        if(this.getOrgpBuyamount() == 0){
           return 0.0;
        }
        return (double) this.getOrgpUseamount() / (double) this.getOrgpBuyamount();
    }
}
